/*
 * Flux JavaScript Library
 * Copyright (c) 2010 Leonardo Dutra Constancio
 * MIT License (http://jsflux.googlecode.com/svn/trunk/mit-license.txt)
 */

flux.Event = function(type, bubbles, cancelable)
{
	if(this instanceof flux.Event)
	{
		this.type = typeof type === 'string' ? type : null;
		this.bubbles = !!bubbles;
		this.cancelable = !!cancelable;
	}
};

flux.Event.prototype =
{

	eventPhase: flux.EventPhase.CAPTURE_PHASE,
	target: null,
	currentTarget: null,
	_propagate: true,

	clone: function()
	{
		var event = new flux.Event(this.type, this.bubbles, this.cancelable);
		event.target = this.target;
		return event;
	},
	preventDefault: function()
	{
		// TODO Event.preventDefault()?
	},
	stopPropagation: function()
	{
		this._propagate = false;
	},
	toString: function()
	{
		return '{Event: type=' + this.type + ', bubbles=' + this.bubbles + ', cancelable=' + this.cancelable + '}';
	}
};
